//特殊加分审核
<template>
    <div class="box">
        <span class="el-input" style="margin-top: 20px">
            年份：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <el-input-number v-model="year" controls-position="right" @change="handleChange" :min="2020" :max="2024"
                class="yearw1"></el-input-number>
        </span>

        <div style="margin-left: 400px; margin-top: -35px; font-size: 13px">
            发布状态
            <el-select v-model="selectedStatus" placeholder="选择发布状态" @change="handleStatusChange">
                <el-option label="待审核" value="pending-review"></el-option>
                <el-option label="待提交" value="pending-submission"></el-option>
                <el-option label="审核通过" value="approved"></el-option>
            </el-select>
        </div>
        <div style="margin-top: 30px">
            <el-button type="primary" plain icon="el-icon-question" size="mini" style="margin-left: 10px"
                @click="tiaozhuan">预审核</el-button>
            <el-button type="primary" plain icon="el-icon-circle-plus" size="mini"
                style="margin-left: 40px">发布</el-button>
            <el-button type="info" plain icon="el-icon-close" size="mini" style="margin-left: 40px">撤回</el-button>
            <el-button type="danger" icon="el-icon-delete" plain size="mini" style="margin-left: 40px">删除</el-button>
            <el-button type="warning" plain icon="el-icon-download" size="mini" style="margin-left: 40px">导出</el-button>
        </div>

        <!--列表-->
        <el-table border :data="list" style="width: 96%; margin-top: 20px;" :row-class-name="tableRowClassName">
            <!-- 定义表格列 -->
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column align="center" prop="object" label="考核对象" width="180"></el-table-column>
            <el-table-column align="center" prop="causeofappeal" label="加分原因" width="285"></el-table-column>
            <el-table-column align="center" prop="applicationscores" label="申诉分值"></el-table-column>
            <el-table-column align="center" prop="audit" label="预审核意见" width="180"></el-table-column>
            <el-table-column align="center" prop="extras" label="审核分值"></el-table-column>
            <el-table-column align="center" prop="Preauditstatus" label="预审核状态" width="180"></el-table-column>
            <el-table-column align="center" prop="publishstatus" label="发布状态" width="180"></el-table-column>
        </el-table>
    </div>
</template>

<script>
  import { save, addl, upda, delet, getyear } from "../../../api/zhenfu/bumen";

export default {
    data() {
        return {
     
        };
    },
    created() {
       
    },
    methods: {
       
                }
            });
        },
        // 合并单元格的方法
        // 修改 arraySpanMethod 方法
        arraySpanMethod({ row, column, rowIndex, columnIndex }) {
            const columnsToMerge = ['special', 'year', 'statet'];

            if (columnIndex === 0) { // 一级指标列的索引
                const one_index = row.one_index;
                const currentValues = columnsToMerge.map(col => row[col]);
                const prevRow = this.list[rowIndex - 1];
                let rowSpan = 1;

                if (prevRow && prevRow.one_index === one_index) {
                    return [0, 0];
                }

                for (let i = rowIndex + 1; i < this.list.length; i++) {
                    if (this.list[i].one_index === one_index &&
                        columnsToMerge.every(col => this.list[i][col] === currentValues[columnsToMerge.indexOf(col)])) {
                        rowSpan++;
                    } else {
                        break;
                    }
                }

                return [rowSpan, 1];
            } else if (columnsToMerge.includes(column.property)) {
                const currentValues = columnsToMerge.map(col => row[col]);
                const prevRow = this.list[rowIndex - 1];
                let rowSpan = 1;

                if (prevRow && columnsToMerge.every(col => prevRow[col] === currentValues[columnsToMerge.indexOf(col)])) {
                    return [0, 0];
                }

                for (let i = rowIndex + 1; i < this.list.length; i++) {
                    if (columnsToMerge.every(col => this.list[i][col] === currentValues[columnsToMerge.indexOf(col)])) {
                        rowSpan++;
                    } else {
                        break;
                    }
                }

                return [rowSpan, 1];
            } else {
                return [1, 1];
            }
        },

        handleDelete() {
            const selectedRows = this.list.filter((item) => item.selected);
            if (selectedRows.length) {
                this.$confirm('确定删除选中的数据吗？', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    const ids = selectedRows.map((row) => row.id);
                    delet({ ids })
                        .then((res) => {
                            this.$message.success('删除成功');
                            this.apply();
                        })
                        .catch((err) => {
                            console.log(err);
                            this.$message.error('删除失败');
                        });
                }).catch(() => {
                    this.$message.info('已取消删除');
                });
            } else {
                this.$message.warning("请先选择要删除的行");
            }
        },
        derive() {
            // 使用xlsx库导出数据
            this.download('traget/book/export', {
                ...this.queryParams
            }, `book_${new Date().getTime()}.xlsx`)
        },
        onRowClick(row) {
            row.selected = !row.selected;
        },
        handleSizeChange(val) {
            this.list.pageSize = val;
            this.apply();
        },
        handleCurrentChange(val) {
            this.list.pageNum = val;
            this.apply();
        },
        cancel() {
            this.open = false;
        }
    }
};
</script>
<style scoped>
.box {
    margin-left: 30px;
    margin-top: 20px;
}
</style>